#include <vector>
#include "ConteneurCode.hpp"
using namespace std;

ConteneurCode::ConteneurCode() {}

ConteneurCode::ConteneurCode(const ConteneurCode& cc) {}

ConteneurCode::~ConteneurCode() {}

void ConteneurCode::ajouterInstruct(Instruction* instr)
{
    if(instr != NULL)
        listeInstruction.push_back(instr);
    else
	{
        cout<<"error: instruction nulle"<<endl;
    }
}
void ConteneurCode::ajouterBlocInstruct(std::vector <Instruction*> blocInstr)
{
    if(!blocInstr.empty())
    {
        std::vector <Instruction*>::iterator it;
        for(it= blocInstr.begin(); it!= blocInstr.end(); it++)
        {
               this->listeInstruction.push_back(*it);
        }
    }
    else{
        cout<<"error: aucune instruction dans la liste";
    }
}
void ConteneurCode::affichage()
{
    cout<< "** Code "<<endl;
    for(unsigned int i=0; i < listeInstruction.size(); i++)
    {
        cout << listeInstruction.at(i)->getaffichageLigne()<<endl;
    }
     //cout<< "---Fin---"<<endl;

}

